from django.contrib import admin

# Register your models here.
from .models import Users,FileModel


@admin.register(Users)
class UserAdmin(admin.ModelAdmin):
    list_display = ("username", "nickname", "email", "user_pic")
    search_fields = ("username", "nickname")
    list_filter = ("username",)
    ordering = ("-id",)
    
@admin.register(FileModel)
class FileAdmin(admin.ModelAdmin):
    list_display = [ "name", "save_name", "size", "url"]
    # 按更新日期排序
    ordering = ("-create_datetime",)
    # 每页显示条目数
    list_per_page = 10


# 设置header
admin.site.site_header = "BigEvent管理后台系统"
# 设置title
admin.site.site_title = "BigEvent管理后台系统"
